/**
 * @author wangxiaowei
 * 组织部发文列表
 */
var sort = null;
var grid = null;

function initgenzonglist(){
	//initselectusertreechecktask();		
var colModel = new Ext.grid.ColumnModel([
		{header:'姓名',dataIndex:'username',menuDisabled : true},
		{header:'环节名称',dataIndex:'taskname',menuDisabled : true},
		{header:'完成时间',dataIndex:'time',menuDisabled : true},
	]);
	var url = Ext.get('url').getValue();
	sort = new Ext.data.JsonStore({
		url:url,
		fields:['username','taskname','time','operate'],
		root:'root',
		totalProperty:'totalProperty'
	});
	var bbar = new Ext.PagingToolbar({
		pageSize:23,
		store:sort,
		displayInfo:true,
		emptyMsg:'没有记录'
	});
	 grid = new Ext.grid.GridPanel({
		title:'行政发文跟踪列表',
		cm:colModel,
		tbar:[{
			 text: '返回',
             iconCls: 'silk-add',
              handler:function(){
             	window.location.href=Ext.get('historyurl').getValue();
             }
		}],		
		renderTo:'topic-grid',
		store:sort,
		loadMask:true,
		height:$(window).height()-17,
		bbar:bbar,
		viewConfig:{
			forceFit:true
		}
	});
	
	sort.on('load', function() {    
		Ext.getCmp('zhuijia').setVisible(false);  
		sort.each(function(record) {
		    if (record.get('taskname') == '封发'){
		    	Ext.getCmp('zhuijia').setVisible(true); 
		    	return false;
		    }
		});		
	});
		
	sort.load({params:{start:0, limit: 23}});
	
}



